<div class="container">
    
    <?php $att = array('class' => 'form-horizontal', 'role' => 'form', 'onsubmit' => 'return postForm()'); echo form_open('', $att);?>
    <div class="col-md-6">
        <div class="row">
            <div class="col-md-12">
              <div class="panel">
                <div id="pop_upload" style="position: absolute;width: 100%;height: 100%;z-index: 999;display: none">
                    <p style="text-align: center;width: 100%;height: 100%;background: #CCC;padding-top: 45%;color: #990000;font-size: 25px;">Đang upload ảnh ...</p>
                </div>
                <div class="panel-heading">
                  <div class="panel-title"> <span class="glyphicon glyphicon-pencil"></span> Quản lý Thông báo + Hotline (TOP) </div>
                </div>
                <div class="panel-body">
                    <?php if(isset($result) || validation_errors()):?>
                    <div class="alert alert-danger alert-dismissable">
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                             <?php if(isset($result)){echo $result;}?>
                            <?php echo validation_errors(); ?>
                    </div>
                    <?php endif;?>
                    <div class="form-group">
                      <label for="inputStandard" class="col-lg-2 control-label">Hotline</label>
                      <div class="col-lg-10">
                        <input type="text" id="hotline" name="hotline" class="form-control" value="<?php echo $data->hotline?>" placeholder="Tên danh mục">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="inputPassword" class="col-lg-2 control-label">Nội dung</label>
                      <div class="col-lg-10">
                          <div id="pop_upload" style="position: absolute;width: 100%;height: 100%;z-index: 999;display: none">
                            <p style="text-align: center;width: 100%;height: 100%;background: #CCC;padding-top: 25%;color: #990000;font-size: 25px;">Đang upload ảnh ...</p>
                        </div>
                        <textarea class="form-control text-field-alt margin-bottom-lg summernote" rows="2" id="summernote" name="content" placeholder="Ghi nội dung mô tả sản phẩm"><?php echo nl2br(strip_slashes($data->notifi))?></textarea>
                      </div>
                    </div>
                  
                </div>
              </div>
            </div>
        </div>
    </div>
    <div class="col-md-3-3">
        <div class="row">
            <div class="col-md-12">
                 <div class="panel">
                    <div class="panel-heading">
                      <div class="panel-title">Hành động</div>
                    </div>
                    <div class="panel-body">
                      <div class="form-group">
                          <div class="col-lg-10" style="width: 100%;">
                            <button type="submit" class="btn btn-info btn-gradient btn-sm">Lưu lại</button>
                            <button type="button" class="btn btn-default btn-gradient btn-sm" onclick="window.location='<?php echo $baseurl.'manage.html'?>'">Hủy bỏ</button>
                          </div>
                        </div>
                    </div>  
                 </div>
            </div>
        </div>
    </div>
    </form>
</div>
<script>
function convertimg()
{
    var chose = chose;
    var filesSelected = document.getElementById("img").files;
    if (filesSelected.length > 0)
    {
        var fileToLoad = filesSelected[0];

        var fileReader = new FileReader();

        fileReader.onload = function(fileLoadedEvent) 
        {
            var textAreaFileContents = document.getElementById
            (
                "textAreaFileContents"
                );
            $("#img_hidden").attr('value', fileLoadedEvent.target.result);
            $("#img_show").attr('src', fileLoadedEvent.target.result);
            
            
        };

        fileReader.readAsDataURL(fileToLoad);
    }
}
function postForm() 
{
	var content = $('textarea[name="content"]').html($('#summernote').code());
}
setTimeout(function()
{
    $(".note-editable").html($("#summernote").val());
},700);
</script>